home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3411 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: mail2news.demon.co.uk!richardc.demon.co.uk
  2. From: Richard Clarke <Richard@richardc.demon.co.uk>
  3. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
  4. Subject: Re: HELP - CString conversion?
  5. Date: Tue, 23 Jan 96 21:18:10 GMT
  6. Organization: Insert-Organisation-Here
  7. Message-ID: <822431890snz@richardc.demon.co.uk>
  8. References: <NEWTNews.16531.822443361.Postmaster@Jerusalem.netvision.net.il>
  9. Reply-To: Richard@richardc.demon.co.uk
  10. X-NNTP-Posting-Host: richardc.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.29
  12. X-Mail2News-Path: richardc.demon.co.uk
  13.  
  14. In article <NEWTNews.16531.822443361.Postmaster@Jerusalem.netvision.net.il>
  15.            iti@Jerusalem.netvision.net.il  writes:
  16.  
  17. > When I try to read the text from a Edit Control (IDC_EDIT1) with the
  18. > following code:
  19. > --------------------------------------------------------------
  20. > CString callBuf;
  21. > int msgLen = GetDlgItemText(IDC_EDIT1, callBuf, sizeof(callBuf));
  22. > --------------------------------------------------------------
  23. > I get the following error:
  24. > --------------------------------------------------------------
  25. > error C2664: 'GetDlgItemText' : cannot convert parameter 2 from 'class 
  26. > ::CString ' to 'char __far *'
  27. > --------------------------------------------------------------
  28. > I am using Visual C++, how can I read the text directly into the CString?
  29. > I know that I am doing something REAL STUPID so if you can be of any help-
  30. > Please send any advice you have for me to my EMail address:
  31. >         iti@netvision.net.il
  32. > Thanks
  33. > Yaakov
  34.  
  35. Unless I am much mistaken, this should do what you want
  36.  
  37.   CString strTest;
  38.   ((CEdit *)GetDlgItem(IDC_EDIT1))->GetWindowText(strTest);
  39.  
  40. I am not emailing this because the point of newsgroups is
  41. to share information and benefit the developer community,
  42. not to answer 1 developer's question.
  43.  
  44. Good luck!
  45.  
  46. -- 
  47. Richard Clarke
  48.